# Copyright 2021 hpmicro
# SPDX-License-Identifier: BSD-3-Clause

cmake_minimum_required(VERSION 3.13)

set(CONFIG_TINYUSB 1)
set(CONFIG_USB_HOST 1)


find_package(hpm-sdk REQUIRED HINTS $ENV{HPM_SDK_BASE})



sdk_compile_definitions(-DBOARD_SHOW_CLOCK=0)
sdk_compile_definitions(-DInfoNES_ENABLE_DOUBLE_FRAME=1)
sdk_compile_definitions(-DCFG_TUSB_MCU=OPT_MCU_HPM)
sdk_compile_definitions(-DUSB_HOST_MCU_CORE=HPM_CORE0)

project(InfoNES)

sdk_compile_options(-O2)

sdk_inc(.)
sdk_inc(src)
sdk_app_src(src/main.c)
sdk_src(src/InfoNES.c)
sdk_src(src/InfoNES_Mapper.c)
sdk_src(src/InfoNES_pAPU.c)
sdk_src(src/InfoNES_System.c)
sdk_src(src/K6502.c)
sdk_src(src/rom.c)
sdk_src(src/hpm_nes_port.c)
generate_ses_project()
